package com.party.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 
 * @author Caizhf
 * @date 2017年5月20日下午3:37:32
 * @version v.0.1
 * @title SpringMVC配置
 *        <p>
 *        Description: 当用户访问login时跳转到login.html页面。
 *        </p>
 * 
 */
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {

	@Override
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addViewController("/index").setViewName("index");
		registry.addViewController("/user").setViewName("/user/index");
		registry.addViewController("/").setViewName("index");
		registry.addViewController("/register").setViewName("register");
		registry.addViewController("/login").setViewName("login");
		registry.addViewController("/user/setting").setViewName("/user/setting");
		registry.addViewController("/user/updatePassword").setViewName("/user/updatePassword");
		registry.addViewController("/topic").setViewName("/topic/index");
		registry.addViewController("/topic/publish").setViewName("/topic/publish");
		registry.addViewController("/topic/detail").setViewName("/topic/detail");
		registry.addViewController("/topic/reply").setViewName("/topic/reply");
		registry.addViewController("/talent").setViewName("/talent/index");
		registry.addViewController("/talent/detail").setViewName("/talent/detail");
		registry.addViewController("/talent/car").setViewName("/talent/car");
		registry.addViewController("/site").setViewName("/site/list");
		registry.addViewController("/site/detail").setViewName("/site/detail");
		//后台
		registry.addViewController("/admin").setViewName("/admin/index");
		registry.addViewController("/admin/site").setViewName("/admin/site/index");
		registry.addViewController("/admin/site/add").setViewName("/admin/site/add");
	}
}